{extend name="public/base" /}
{block name="body"}
<div class="layui-fluid">
    <div class="layui-row">
        <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
			<div class="widget-head">
				<div class="widget-title a m-cf">配置管理</div>
			</div>
			<div class="widget-body layui-col-sm12 layui-col-md12 layui-col-lg12">
				<div class="layui-u-sm-3 layui-u-md-3 layui-col-lg3">
					<!-- 工具栏 -->
					<div class="page_toolbar">
						<div class="layui-btn-group">
							<a class="layui-btn" href="{:url('Config/add')}"><i class="menu-icon fa fa-plus"></i> 新增</a>
						</div>
					</div>
				</div>
				<div class="layui-u-sm-9 layui-u-md-9 layui-col-lg9">
					<form action="{:url('Config/index')}" class="layui-form" method="get">
            			<div class="layui-form-item">
                			<div class="layui-input-inline">
                    			<input type="text" name="title" value="{:input('title')}" autocomplete="off" placeholder="请输入标题" class="layui-input"/>
                			</div>
                			<div class="layui-input-inline">
                    			<select name="group">
                       	 			<option value="">全部分组</option>
                        			{volist name="Think.config.config_group_list" id="group"}
                        			<option value="{$key}">{$group}</option>
                        			{/volist}
                    			</select>
                			</div>
                			<div class="layui-input-inline">
                    			<button class="layui-btn layui-btn-primary ajax-search"><i class="fa fa-search"></i></button>
                			</div>
            			</div>
        			</form>
				</div>				
				<div class="layui-col-md12" >
					<table class="layui-table layui-form">
            			<thead>
            				<tr>
                				<th>ID</th>
                				<th>名称</th>
                				<th>标题</th>
                				<th>分组</th>
                				<th>类型</th>
                				<th>排序</th>
                				<th>状态</th>
                				<th width="120">操作</th>
            				</tr>
            			</thead>
            			<tbody>
            			{volist name="list" id="vo"}
            				<tr>
                				<td>{$vo.id}</td>
                				<td>{$vo.name}</td>
                				<td>{$vo.title}</td>
                				<td>{$vo.group|get_config_group}</td>
                				<td>{$vo.type|get_config_type}</td>
                				<td>
                    				<input type="text" name="sort" value="{$vo.sort}" autocomplete="off" class="layui-input ajax-update" data-url="{:url('Config/update?id='.$vo['id'])}">
                				</td>
                				<td>
                    				<input type="checkbox" name="status" lay-skin="switch" lay-filter="*" lay-text="启用|禁用" data-url="{:url('Config/update?id='.$vo['id'])}" {if $vo.status eq 1}checked="checked"{/if}>
                				</td>
               					<td>
                    				<a href="{:url('Config/edit?id='.$vo['id'])}" class="layui-btn layui-btn-xs layui-btn-normal"><i class="fa fa-edit"></i> 编辑</a>
                    				<a href="{:url('Config/del?id='.$vo['id'])}" class="layui-btn layui-btn-xs layui-btn-danger ajax-delete"><i class="fa fa-trash-o"></i> 删除</a>
                				</td>
            				</tr>
            			{/volist}
            			</tbody>
        			</table>
        			<div class="page">{$list->render()|raw}</div>
				</div>
			</div>
		</div>
	</div>
</div>
{/block}